home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2004 April
/
CMCD0404.ISO
/
Software
/
Shareware
/
Programare
/
sharp
/
wwwSharp_setup.exe
/
{app}
/
Examples
/
Data access
/
Update
/
index.hta
next >
Wrap
Text File
|
2003-12-28
|
3KB
|
115 lines
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>wwwSharp.ClrHost update example</TITLE>
<META name="GENERATOR" content="MSHTML 6.00.2800.1276">
<META http-equiv="MSThemeCompatible" content="Yes">
<LINK href="Update.css" type="text/css" rel="stylesheet">
<OBJECT id="AppDomain" classid="clsid:89F1D07D-3AC6-4ACB-B8A4-8EDDDCB0142E"></OBJECT>
<OBJECT id="dsDataSet" classid="clsid:A53ECD51-C062-4B08-97F0-4944CD7D88E7">
<PARAM name="AssemblyName"
value="System.Data, Version=1.0.5000.0, PublicKeyToken=b77a5c561934e089, Culture=neutral">
<PARAM name="DataAdapterTypeName" value="System.Data.OleDb.OleDbDataAdapter">
<PARAM name="ConnectionTypeName" value="System.Data.OleDb.OleDbConnection">
<PARAM name="CommandBuilderTypeName" value="System.Data.OleDb.OleDbCommandBuilder">
</OBJECT>
<OBJECT id="viewCountry" classid="clsid:E3BC8FCA-E3F4-4B98-8627-9D3D343F9DA0">
<PARAM name="DataSetID" value="dsDataSet">
<PARAM name="TableName" value="country">
</OBJECT>
<SCRIPT language="JScript">
function Initialize()
{
//ApplicationBase for main domain is directory where HTA is located.
dsDataSet.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
AppDomain.ApplicationBase + "test.mdb";
dsDataSet.FillTable("country", "Select * from country");
viewCountry.Open();
}
function OnBtnUpdate()
{
//Send updates to DBMS
dsDataSet.Update("country");
}
function viewCountryMoveFirst()
{
viewCountry.recordset.MoveFirst()
}
function viewCountryMovePrevious()
{
viewCountry.recordset.MovePrevious();
if (viewCountry.recordset.BOF)
viewCountry.recordset.MoveFirst();
}
function viewCountryMoveNext()
{
viewCountry.recordset.MoveNext();
if (viewCountry.recordset.EOF)
viewCountry.recordset.MoveLast();
}
function viewCountryMoveLast()
{
viewCountry.recordset.MoveLast();
}
</SCRIPT>
</HEAD>
<BODY onload="Initialize()">
<H2>Countries:</H2>
<DIV id="divNavigation">
<BUTTON id="btnFirst" onclick="viewCountryMoveFirst()">< <</BUTTON>
<BUTTON id="btnPrev" onclick="viewCountryMovePrevious()"><</BUTTON>
<BUTTON id="btnNext" onclick="viewCountryMoveNext()">></BUTTON>
<BUTTON id="btnLast" onclick="viewCountryMoveLast()">> ></BUTTON>
</DIV>
<DIV id="divTable">
<TABLE id="tblCustomers" width="100%">
<TBODY>
<TR>
<TD class="tdHeader">Name</TD>
<TD>
<INPUT dataFld="Name" dataSrc="#viewCountry">
</TD>
</TR>
<TR>
<TD class="tdHeader">Capital</TD>
<TD>
<INPUT dataFld="Capital" dataSrc="#viewCountry">
</TD>
</TR>
<TR>
<TD class="tdHeader">Continent</TD>
<TD>
<INPUT dataFld="Continent" dataSrc="#viewCountry">
</TD>
</TR>
<TR>
<TD class="tdHeader">Area</TD>
<TD>
<INPUT dataFld="Area" dataSrc="#viewCountry">
</TD>
</TR>
<TR>
<TD class="tdHeader">Population</TD>
<TD>
<INPUT dataFld="Population" dataSrc="#viewCountry">
</TD>
</TR>
</TBODY>
</TABLE>
<BUTTON id="btnUpdate" onclick="OnBtnUpdate();">Update</BUTTON>
</DIV>
<DIV id="divFooter">
<P id="creator">Created with <A href="http://www-sharp.com/" target="_blank"><STRONG>
www-Sharp</STRONG></A>.</P>
</DIV>
</BODY>
</HTML>